
<!doctype html>
<html class="no-js" lang="">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Untitled Document</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="apple-touch-icon.png">
    <!-- Place favicon.ico in the root directory -->

    <link rel="stylesheet" type="text/css" href="../../css/reset.css">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-default/index.css">
    
</head>

<body>
    <div class="loading">
        <span class="loadImg"></span>
    </div>
    <div id="app" class="prcAdd">
        <div class="info inputList">
            <p class="mt20"><span>抽奖积分:</span><input type="text" class="t1 mel" name=""></p>
            <p><button class="addClick">提交</button></p>
        </div>
    </div>
</body>

</html>
<script src="../../js/jquery.js"></script>
<script src="../../js/jquery.cookie.js"></script>
<script type="text/javascript" src="../../js/nicEdit.js"></script>
<script type="text/javascript">
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
</script>
<script type="text/javascript">

    $(function(){
        
        getData();

        function getData(){
            var admintoken=$.cookie('admintoken');
            if(admintoken!=null){
                $('.loading').show();
                $.ajax({
                    type: 'get',
                    url:'http://www.math80.com/games/prizes/setting',
                    headers:{Authorization:"Bearer "+admintoken},
                    success:function(data){
                        $('.t1').val(data.data.need_integration)
                        $('.loading').hide();
                    }
                })
            }else{
                $('.login').css('display','block')
            }
        }

        //提交数据
        $('.addClick').click(function(){
            var admintoken=$.cookie('admintoken');
            if(admintoken!=null){
                $('.loading').show();

                var num=$('.t1').val();
                var data={
                        "need_integration":num
                        };
                $.ajax({
                    type: 'POST',
                    url:'http://www.math80.com/games/prizes/setting',
                    headers:{Authorization:"Bearer "+admintoken},
                    data:data,
                    success:function(data){
                        $('.loading').hide();
                        alert('修改成功')
                        getData();
                    }
                })
            }
            

        })





    })

</script>
<!-- <script src="../../js/vue.min.js"></script>
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript">
    new Vue({
      el: '#app',
      data: function() {
        return { 
            visible: false,
            value1: false,
        }
      }
    })
</script> -->
